Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

3D Metafile Header

Labels

ASCII
3DMetafile
Binary
3DMF (= 0x33444D46 )

metafile flags

Each metafile header includes a flag that indicates the uses to which file pointers and reference objects are put in that metafile. The left column below gives the form of the flag found in text metafiles, while the right colun gives the form found in binary metafiles.

Normal              0x00000000
Stream              0x00000001
Database            0x00000002

Constant descriptions

Normal
This flag indicates that objects in the metafile can be instantiated by reference, using the mechanism of file pointers and reference objects described above. The table of contents contains only entries for objects that actually have at least one instantiation by reference. (Note that normal metafiles are not prohibited from having the same full description of an object occur in two different places in the file.) In order to read a normal metafile, a parser should have random access to that file.
Stream
This flag indicates that there are no internal references in the metafile. Objects cannot be instantiated by reference; the complete specification of an object must occur at each place in the file at which that object is to be instantiated. In order to read a stream metafile, a parser need have sequential access only.
Database
This flag indicates that every shared object in the metafile that is not itself a reference object is the target object of a file pointer appearing in a table of contents in the metafile. That is, every object that could be instantiated by reference and is not itself a reference object must be listed in a table of contents (whether or not that object has actually been instantiated by reference in this file). All of the shared contents of a database metafile may be discovered by a parser through examination of its tables of contents. Note that an object can be both stream and database; this means that there are no reference objects but the metafile contains a complete table of contents for the shared objects.

Data Format

    Uns16                               majorVersion
    Uns16                               minorVersion
    MetafileFlags                       flags
    FilePointer                         tocLocation
majorVersion
The version number of the metafile. Currently, the version number is 1.
minorVersion
The revision number of the metafile. Currently, the revision number is 5.
flags
The metafile header flag.
tocLocation
A file pointer to the location (in the metafile) of a table of contents object. If the value in this field is NULL , then the entire metafile must be parsed in order to find any extant tables of contents.

Data Size

20

Description

A metafile header is a structure having four fields. The first two fields specify the version and revision numbers of the metafile. The third field contains a flag indicating the type of the metafile (normal, stream, or database). The fourth field contains a pointer to the location of a table of contents for the metafile. A metafile header in a file indicates that the file is a metafile and provides some information about its contents.

Each metafile must contain exactly one metafile header, and this header must precede every other object in that file. Though each metafile header contains a pointer to the location of a table of contents, there need be no corresponding table of contents in the metafile.

Parent Hierarchy

3DMF.

Parent Objects

None.

Child Objects

None.

Example

3DMetafile ( 1 5 Normal tableofcontents0> )
    box2:
    Box (
        0 0 1                       # orientation
        1 0 0                       # majorAxis
        0 0 0                       # minorAxis
        0 1 0                       # origin
    )

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |